﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using WPFExcelReport.Helpers;
using System.Collections;
using System.Collections.Generic;
namespace WPFExcelReport
{
    public partial class TBZ02
    {
         
        public TBZ02()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VBABST();
            this.DataContext = MV;
            InitializeComponent();

        }

        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            base.Window_Loaded(sender, e);
        } 
        public override void OnEXAUFChg(string vlaue)
        {
            TBMain.Clear();
            if (EXAUF.Length <45)
                return;
            ART = EXAUF.Substring(1, 20);
            VAR= EXAUF.Substring(21, 2);
            FARBE= EXAUF.Substring(23, 10);
            KRS= EXAUF.Substring(33, 2);
            LFD = EXAUF.Substring(35, 6);
            POS = EXAUF.Substring(41, 3);
            UPOS = EXAUF.Substring(44, 2);

            dwData = TBMain.NewRow();
            dwData["BMMANDANT"] = app.Mandant;
            dwData["BMKART"] = EXAUF.Substring(1, 20);
            dwData["BMKVAR"] = EXAUF.Substring(21, 2);
            dwData["BMFARBE"] = EXAUF.Substring(23, 10); 
            SResult = TMV.QBABST04(dwData);
            MergeData(SResult, true, true); 
            base.OnEXAUFChg(vlaue);
        }
        public override void NewCommand(object sender, RoutedEventArgs e)
        {
            base.NewCommand(sender, e);
        }
        public override void DeleteCommand(object sender, RoutedEventArgs e)
        {
            base.DeleteCommand(sender, e);
        }
    }
}
